#ifndef __WIZ_DATATYPE_DEQUE_HPP__SHANHAOBO_19800429__
#define __WIZ_DATATYPE_DEQUE_HPP__SHANHAOBO_19800429__

#include <deque>

#include "../../Base/WizBase.hpp"
#include "./WizDataTypeForEach.hpp"

namespace Wiz
{
    namespace Deque
    {
        template<class T>
        struct Type : private ::std::deque<T>
        {
            //////////////////////////////////////////////////////////////////////////
            typedef ::std::deque<T>                                 tSuper;
            typedef ::Wiz::Deque::Type<T>                           tThis;
            typedef typename tSuper::iterator                       tIterator;
            typedef typename tSuper::const_iterator                 tIteratorConst;
            typedef typename tSuper::iterator::value_type           tValue;
            typedef typename tSuper::const_iterator::value_type     tValueConst;
            typedef typename tSuper::reference                      tReference;
            typedef typename tSuper::const_reference                tReferenceConst;
            //////////////////////////////////////////////////////////////////////////
            typedef ::Wiz::ForEach::Type<::Wiz::Deque::Type<T>>           tForEach;
            typedef ::Wiz::ConstForEach::Type<::Wiz::Deque::Type<T>>      tForEachConst;

            typedef ::Wiz::ForEachIter::Type<::Wiz::Deque::Type<T>>       tForEachIter;
            //////////////////////////////////////////////////////////////////////////
		public:
			Type() : tSuper(){}
			Type(const tSuper& InSuper) : tSuper(InSuper){}
		public:
            tIterator Begin()
            {
                return tSuper::begin();
            }

            tIteratorConst Begin() const
            {
                return tSuper::begin();
            }

            tIterator End()
            {
                return tSuper::end();
            }

            tIteratorConst End() const
            {
                return tSuper::end();
            }

            ///-----------------------///

            ::Wiz::Size::Type Size() const
            {
                return ::Wiz::Cast::Static<::Wiz::Size::Type>(tSuper::size());
            }

            ::Wiz::Void::Type Clear()
            {
                tSuper::clear();
            }

            tIterator Erase(tIterator itr)
            {
                return tSuper::erase(itr);
            }

            ///-----------------------///

            template<class FuncT>
            ::Wiz::Void::Type FindIf(FuncT Func)
            {
                ::std::find_if(tSuper::begin(), tSuper::end(), Func);
            }

            template<class FuncT>
            ::Wiz::Void::Type RemoveIf(FuncT Func)
            {
                tSuper::iterator newend = ::std::remove_if(tSuper::begin(), tSuper::end(), Func);
                tSuper::erase(newend, tSuper::end());
            }

            ///-----------------------///


            ::Wiz::Void::Type PushBack(const T& v)
            {
                tSuper::push_back(v);
            }

            ::Wiz::Void::Type PushFront(const T& v)
            {
                tSuper::push_front(v);
            }

            ::Wiz::Void::Type PopBack(const T& v)
            {
                tSuper::pop_back(v);
            }

            ::Wiz::Void::Type PopFront(const T& v)
            {
                tSuper::pop_front(v);
            }

            tReference Front()
            {
                return tSuper::front();
            }

            tReference Back()
            {
                return tSuper::back();
            }
        };
    } /// end of namespace Deque
} /// end of namespace Wiz

#endif /*__WIZ_DATATYPE_DEQUE_HPP__SHANHAOBO_19800429__*/
